from house import *

class HouseService:
    __house_list = []

    def __init__(self):
        default_house = House(1,"wcb","123","gd",500,"未出租")
        self.__house_list.append(default_house)


    def get_house_list(self):
        return  self.__house_list

    def add_house(self,new_house):
        self.__house_list.append(new_house)


    def find_house(self,find_id):
        for house in self.__house_list:
            if house.house_id == find_id:
                return house

    def del_house(self,del_id):
        house = self.find_house(del_id)
        if house:
            self.__house_list.remove(house)
            return True
        return False